package com.wash.car.web.controller.admin;

import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.pmo.boot.common.BizException;
import com.pmo.boot.common.api.BaseResult;
import com.pmo.boot.common.api.DefaultResult;
import com.wash.car.biz.AdminUserServer;
import com.wash.car.dao.domain.AdminUserDomain;
import com.wash.car.dao.model.AdminUserPwdModel;
import com.wash.car.web.config.CacheConfiguration;
import com.wash.car.web.config.context.UserContext;
import com.wash.car.web.config.context.UserInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = {"用户管理"})
@RestController
@RequestMapping(path = "/admin/user")
public class AdminUserController {

    @Autowired
    private AdminUserServer adminUserServer;

    @ApiOperation(value = "设置密码")
    @PostMapping(path = "setPwd")
    public BaseResult setPwd(@RequestBody AdminUserPwdModel model) {
        Long userId = UserContext.get().getUserId();
        adminUserServer.setPwd(userId, model.getPassword());
        return BaseResult.success();
    }



}
